.class public Lrexsee/barcode/DecodeThread;
.super Ljava/lang/Thread;
.source "DecodeThread.java"


# static fields
.field public static final BARCODE_BITMAP:Ljava/lang/String; = "barcode_bitmap"


# instance fields
.field private handler:Landroid/os/Handler;

.field private final handlerInitLatch:Ljava/util/concurrent/CountDownLatch;

.field private final hints:Ljava/util/Hashtable;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Hashtable",
            "<",
            "Lcom/google/zxing/DecodeHintType;",
            "Ljava/lang/Object;",
            ">;"
        }
    .end annotation
.end field

.field private final mDialog:Lrexsee/barcode/BarcodeCaptureDialog;


# direct methods
.method public constructor <init>(Lrexsee/barcode/BarcodeCaptureDialog;)V
    .locals 3
    .param p1, "dialog"    # Lrexsee/barcode/BarcodeCaptureDialog;

    .prologue
    .line 23
    invoke-direct {p0}, Ljava/lang/Thread;-><init>()V

    .line 24
    iput-object p1, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    .line 25
    new-instance v0, Ljava/util/concurrent/CountDownLatch;

    const/4 v1, 0x1

    invoke-direct {v0, v1}, Ljava/util/concurrent/CountDownLatch;-><init>(I)V

    iput-object v0, p0, Lrexsee/barcode/DecodeThread;->handlerInitLatch:Ljava/util/concurrent/CountDownLatch;

    .line 26
    new-instance v0, Ljava/util/Hashtable;

    const/4 v1, 0x3

    invoke-direct {v0, v1}, Ljava/util/Hashtable;-><init>(I)V

    iput-object v0, p0, Lrexsee/barcode/DecodeThread;->hints:Ljava/util/Hashtable;

    .line 27
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->hints:Ljava/util/Hashtable;

    sget-object v1, Lcom/google/zxing/DecodeHintType;->POSSIBLE_FORMATS:Lcom/google/zxing/DecodeHintType;

    iget-object v2, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    iget-object v2, v2, Lrexsee/barcode/BarcodeCaptureDialog;->mDecodeFormats:Ljava/util/Vector;

    invoke-virtual {v0, v1, v2}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 28
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    iget-object v0, v0, Lrexsee/barcode/BarcodeCaptureDialog;->mCharacterSet:Ljava/lang/String;

    if-eqz v0, :cond_0

    .line 29
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->hints:Ljava/util/Hashtable;

    sget-object v1, Lcom/google/zxing/DecodeHintType;->CHARACTER_SET:Lcom/google/zxing/DecodeHintType;

    iget-object v2, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    iget-object v2, v2, Lrexsee/barcode/BarcodeCaptureDialog;->mCharacterSet:Ljava/lang/String;

    invoke-virtual {v0, v1, v2}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 32
    :cond_0
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->hints:Ljava/util/Hashtable;

    sget-object v1, Lcom/google/zxing/DecodeHintType;->NEED_RESULT_POINT_CALLBACK:Lcom/google/zxing/DecodeHintType;

    new-instance v2, Lrexsee/barcode/DecodeThread$1;

    invoke-direct {v2, p0}, Lrexsee/barcode/DecodeThread$1;-><init>(Lrexsee/barcode/DecodeThread;)V

    invoke-virtual {v0, v1, v2}, Ljava/util/Hashtable;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 42
    return-void
.end method

.method static synthetic access$0(Lrexsee/barcode/DecodeThread;)Lrexsee/barcode/BarcodeCaptureDialog;
    .locals 1

    .prologue
    .line 18
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    return-object v0
.end method


# virtual methods
.method public getHandler()Landroid/os/Handler;
    .locals 1

    .prologue
    .line 45
    :try_start_0
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->handlerInitLatch:Ljava/util/concurrent/CountDownLatch;

    invoke-virtual {v0}, Ljava/util/concurrent/CountDownLatch;->await()V
    :try_end_0
    .catch Ljava/lang/InterruptedException; {:try_start_0 .. :try_end_0} :catch_0

    .line 48
    :goto_0
    iget-object v0, p0, Lrexsee/barcode/DecodeThread;->handler:Landroid/os/Handler;

    return-object v0

    .line 46
    :catch_0
    move-exception v0

    goto :goto_0
.end method

.method public run()V
    .locals 4

    .prologue
    .line 54
    :try_start_0
    invoke-static {}, Landroid/os/Looper;->prepare()V

    .line 55
    new-instance v1, Lrexsee/barcode/DecodeHandler;

    iget-object v2, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    iget-object v3, p0, Lrexsee/barcode/DecodeThread;->hints:Ljava/util/Hashtable;

    invoke-direct {v1, v2, v3}, Lrexsee/barcode/DecodeHandler;-><init>(Lrexsee/barcode/BarcodeCaptureDialog;Ljava/util/Hashtable;)V

    iput-object v1, p0, Lrexsee/barcode/DecodeThread;->handler:Landroid/os/Handler;

    .line 56
    iget-object v1, p0, Lrexsee/barcode/DecodeThread;->handlerInitLatch:Ljava/util/concurrent/CountDownLatch;

    invoke-virtual {v1}, Ljava/util/concurrent/CountDownLatch;->countDown()V

    .line 57
    invoke-static {}, Landroid/os/Looper;->loop()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 61
    :goto_0
    return-void

    .line 58
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 59
    .local v0, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/barcode/DecodeThread;->mDialog:Lrexsee/barcode/BarcodeCaptureDialog;

    invoke-virtual {v1}, Lrexsee/barcode/BarcodeCaptureDialog;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-virtual {v0}, Ljava/lang/Exception;->getLocalizedMessage()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x1

    invoke-static {v1, v2, v3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast;

    move-result-object v1

    invoke-virtual {v1}, Landroid/widget/Toast;->show()V

    goto :goto_0
.end method
